<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="js/jquery.cookie.js"></script>
<script type="text/javascript" src="js/jquery.blockUI.js"></script>
<script type="text/javascript" src="js/commen.js"></script>
<script type="text/javascript">
$(document).ready(function() {

	if($.cookie('username') != null){
		$('#username').val( $.cookie('username') );
	}
	if($.cookie('hashed_password') != null){
		$('#password').val( $.cookie('hashed_password') );
	}
	

	$('#login').click(function(){
		if($('#username').val().length > 0 && $('#password').val().length > 0){
			login($('#username').val(), $('#password').val(), 'manual');
		}else{
			alert('Please fill in username and password.');
		}
	});	
	
	if($.cookie('hashed_password') != null){
		login($('#username').val(), $('#password').val(), 'auto');
	}
});
</script>
<body>
Username: <input id="username" type="text" value="" /> <br />
Password: <input id="password" type="password" />
<input id="login" type="button" value="login" />
</body>